package o;

import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager.NameNotFoundException;
import android.net.Uri;
import android.net.Uri.Builder;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.huawei.appgallery.downloadengine.api.SessionDownloadTask;
import com.huawei.appgallery.downloadengine.api.SplitTask;
import com.huawei.appgallery.serverreqkit.api.bean.ResponseBean;
import com.huawei.appmarket.service.appdetail.bean.report.GeneralResponse;
import com.huawei.appmarket.service.appdetail.bean.report.GeneralResponse.DownloadConfigData;
import com.huawei.appmarket.service.deamon.download.NetworkStateChangeHandler;
import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import com.huawei.hwid.core.constants.HwAccountConstants;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import o.dtz.a;
import o.edc.b;
import o.ewm.n;

public class dvt {
    private static final Object ʻ = new byte[0];
    private static volatile dvt ʽ = null;
    private boolean ˊ = false;
    private bna ˋ;
    private dvv ˎ = new dvv();
    private bnh ˏ = ((bnh) fho.ˏ().ˋ("DownloadEngine").ॱ(bnh.class));
    public List<String> ॱ = new ArrayList();
    private boolean ॱॱ = false;

    static class e implements b {
        SessionDownloadTask ˋ;
        bnh ˎ;

        public e(SessionDownloadTask sessionDownloadTask, bnh o_bnh) {
            this.ˋ = sessionDownloadTask;
            this.ˎ = o_bnh;
        }

        public void ˋ(boolean z, Bundle bundle) {
            if (!z) {
                Intent intent = new Intent();
                intent.setAction(dvq.ˎ());
                Bundle bundle2 = new Bundle();
                bundle2.putString("PACKAGE_NAME", this.ˋ.ˊˊ());
                intent.putExtras(bundle2);
                ContentManager.getInstant().getContext().sendBroadcast(intent, dvq.ॱ());
            } else if (this.ˋ != null && this.ˎ != null) {
                dvt.ˏ().ʽ(this.ˋ);
            }
        }
    }

    private dvt() {
    }

    public static dvt ˏ() {
        dvt o_dvt;
        synchronized (ʻ) {
            if (ʽ == null) {
                ʽ = new dvt();
            }
            o_dvt = ʽ;
        }
        return o_dvt;
    }

    private static SessionDownloadTask ॱॱ(SessionDownloadTask sessionDownloadTask) {
        if (sessionDownloadTask.ˌ() != 2) {
            for (SplitTask splitTask : sessionDownloadTask.ᐝˊ()) {
                try {
                    splitTask.ˋ(ˏ(Uri.parse(splitTask.ᐝ()), "subsource", "WLANDelay").toString());
                } catch (RuntimeException e) {
                    Logger.e("HiAppDownload", "convertToReserveTask exception:" + e.getMessage());
                }
                int ˌ = sessionDownloadTask.ˌ();
                if (!(ˌ == 10 || ˌ == 9 || ˌ == 8)) {
                    sessionDownloadTask.ˋॱ(2);
                }
            }
        }
        return sessionDownloadTask;
    }

    private static SessionDownloadTask ᐝ(SessionDownloadTask sessionDownloadTask) {
        if (sessionDownloadTask.ˌ() == 2) {
            sessionDownloadTask.ˋॱ(0);
            for (SplitTask splitTask : sessionDownloadTask.ᐝˊ()) {
                try {
                    Uri parse = Uri.parse(splitTask.ᐝ());
                    String str = "subsource";
                    Set<String> queryParameterNames = parse.getQueryParameterNames();
                    if (queryParameterNames.contains(str) && parse.getQueryParameter(str).equals("WLANDelay")) {
                        Builder clearQuery = parse.buildUpon().clearQuery();
                        for (String str2 : queryParameterNames) {
                            if (!str2.equals(str)) {
                                clearQuery.appendQueryParameter(str2, parse.getQueryParameter(str2));
                            }
                        }
                        splitTask.ˋ(clearQuery.build().toString());
                    }
                } catch (RuntimeException e) {
                    Logger.e("HiAppDownload", "convertToNormalTask exception:" + e.getMessage());
                }
            }
        }
        return sessionDownloadTask;
    }

    private static Uri ˏ(Uri uri, String str, String str2) {
        return uri.getQueryParameterNames().contains(str) ? uri : uri.buildUpon().appendQueryParameter(str, str2).build();
    }

    public static int ॱ(Context context) {
        if (doo.ʻ(context)) {
            return 1;
        }
        if (!doo.ॱॱ(context)) {
            return 0;
        }
        if (doo.ᐝ(context)) {
            return 2;
        }
        return 4;
    }

    public void ˊ() {
        this.ˏ.ˎ();
    }

    public void ˋ() {
        String str = "hispace";
        if (ContentManager.getInstant().getContext().getPackageName().toLowerCase(Locale.getDefault()).contains("game")) {
            str = "higame";
        }
        ˏॱ();
        this.ˋ = new esf(str);
        this.ˏ.ˊ(this.ˋ);
        this.ˏ.ˊ(new dvw());
        this.ˏ.ॱ(this.ˎ);
        this.ˏ.ˎ(ContentManager.getInstant().getContext(), dnb.ॱ());
        ᐝॱ();
        dno.ॱ().ˎ(ContentManager.getInstant().getContext());
        NetworkStateChangeHandler.ॱ().ˊ();
    }

    private void ˏॱ() {
        cdw.ˋ().ˋ(1, djy.class);
        cdw.ˋ().ˋ(2, a.class);
        cdw.ˋ().ˋ(4, ejw.class);
        cdw.ˋ().ˋ(3, djy.class);
    }

    public void ॱ() {
        if (!this.ˊ) {
            Logger.ˎ("HiAppDownload", "begin restoreDownload");
            ʼ();
            this.ˊ = true;
        }
    }

    public boolean ˎ() {
        return this.ˏ.ˋ();
    }

    public boolean ʻ() {
        for (SessionDownloadTask ˈ : ͺ()) {
            if (ˈ.ˈ() == -1) {
                return true;
            }
        }
        return false;
    }

    public boolean ॱ(SessionDownloadTask sessionDownloadTask, boolean z) {
        if (!ॱᐝ()) {
            return false;
        }
        if (sessionDownloadTask == null) {
            return false;
        }
        if (8 == sessionDownloadTask.ˌ() && z) {
            sessionDownloadTask.ˋॱ(11);
        }
        Logger.ˎ("HiAppDownload", "DownloadProxyV2 startTask : " + (dof.ˋ(sessionDownloadTask.ˊˊ()) ? HwAccountConstants.NULL : sessionDownloadTask.ˊˊ()));
        Context ˋ = ContentManager.getInstant().getContext();
        if (VERSION.SDK_INT != 23 || eqh.ˎ().ˏ()) {
            ʽ(sessionDownloadTask);
            if (!edl.ˏ().ˏॱ()) {
                ˎ(0);
            }
        } else if (-1 == ˋ.checkSelfPermission("android.permission.READ_EXTERNAL_STORAGE") || -1 == ˋ.checkSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE")) {
            ˎ(new String[]{"android.permission.READ_EXTERNAL_STORAGE", "android.permission.WRITE_EXTERNAL_STORAGE"}, sessionDownloadTask, n.ʼˈ);
        } else {
            ʽ(sessionDownloadTask);
            if (!edl.ˏ().ˏॱ()) {
                ˎ(0);
            }
        }
        return true;
    }

    public boolean ˏ(SessionDownloadTask sessionDownloadTask) {
        return ॱ(sessionDownloadTask, true);
    }

    public boolean ˎ(SessionDownloadTask sessionDownloadTask) {
        if (!ॱᐝ()) {
            return false;
        }
        sessionDownloadTask.ˋ(false);
        sessionDownloadTask.ˋ(new dvw());
        if (!ˊ(sessionDownloadTask)) {
            sessionDownloadTask.ˋॱ(0);
        }
        if (sessionDownloadTask.ˌ() == 2) {
            ᐝ(sessionDownloadTask);
        }
        if (sessionDownloadTask.ˌ() == 8) {
            sessionDownloadTask.ˋॱ(11);
        }
        if (sessionDownloadTask.ˌ() == 1) {
            sessionDownloadTask.ˋॱ(0);
            sessionDownloadTask.ˋ(0);
        }
        ˊ(sessionDownloadTask.ʾ());
        if (!edl.ˏ().ˏॱ()) {
            ˎ(0);
        }
        return true;
    }

    public int ˎ(int i, dwh o_dwh) {
        Logger.ˎ("HiAppDownload", "DownloadProxyV2 resumeAllByReason, reason=" + i);
        int i2 = 0;
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            int i3;
            if (ˎ(sessionDownloadTask, false) && sessionDownloadTask.ˈ() == 6 && sessionDownloadTask.ᐝॱ() == i) {
                if (o_dwh != null) {
                    o_dwh.ˏ(sessionDownloadTask);
                }
                ˊ(sessionDownloadTask.ʾ());
                i3 = i2 + 1;
            } else {
                i3 = i2;
            }
            i2 = i3;
        }
        return i2;
    }

    public void ˊ(SessionDownloadTask sessionDownloadTask, boolean z) {
        Logger.ˎ("HiAppDownload", "DownloadProxyV2.doInstantDownload , package=" + sessionDownloadTask.ˊˊ());
        sessionDownloadTask.ˋ(true);
        sessionDownloadTask.ʼ(z);
        SessionDownloadTask ˋ = ˋ(sessionDownloadTask.ˊˊ());
        if (ˋ != null) {
            ˋ.ˋ(true);
            ˋ.ʼ(false);
            ˋ.ˋ(sessionDownloadTask.ͺॱ());
            ˊ(ˋ.ʾ());
            return;
        }
        ˏ(sessionDownloadTask);
    }

    public void ˏ(long j, String str, int i) {
        SessionDownloadTask ˎ = ˎ(j);
        if (ˎ != null) {
            ˎ(ˎ, i, true);
            return;
        }
        Logger.ˎ("HiAppDownload", "no download task, taskid=" + j);
        int ˋ = ((cdg) cdb.ॱ(cdg.class)).ˋ(str);
        switch (ˋ) {
            case 1:
                Logger.ˎ("HiAppDownload", str + " is already downloaded");
                return;
            case 10:
                Logger.ˎ("HiAppDownload", str + " is waiting install");
                return;
            case 11:
                Logger.ˎ("HiAppDownload", str + " is installing");
                return;
            default:
                Logger.ˎ("HiAppDownload", "appStatus=" + ˋ);
                return;
        }
    }

    public void ˏ(long j) {
        ˋ(j, 1);
    }

    public void ˋ(long j, int i) {
        SessionDownloadTask ˎ = ˎ(j);
        if (ˎ != null) {
            ˎ(ˎ, i, true);
        }
    }

    public int ˋ(int i) {
        Logger.ˎ("HiAppDownload", "DownloadProxyV2.pauseAll reason=" + i);
        int i2 = 0;
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            int i3;
            if (sessionDownloadTask.ʻ()) {
                this.ˏ.ˎ(sessionDownloadTask.ʾ(), i);
                if (ˊ(sessionDownloadTask)) {
                    i3 = i2 + 1;
                }
                i3 = i2;
            } else {
                ˎ(sessionDownloadTask, i, true);
                i3 = i2;
            }
            i2 = i3;
        }
        return i2;
    }

    public void ˎ(SessionDownloadTask sessionDownloadTask, int i, boolean z) {
        if (1 == i && sessionDownloadTask.ˌ() == 8 && z) {
            sessionDownloadTask.ˋॱ(11);
        }
        if (sessionDownloadTask.ʻ()) {
            this.ˏ.ˎ(sessionDownloadTask.ʾ(), i);
        } else if (sessionDownloadTask.ˈ() == 6) {
            if (i == 1 && sessionDownloadTask.ᐝॱ() != 1) {
                sessionDownloadTask.ʽ(false);
                this.ˏ.ˎ(sessionDownloadTask.ʾ(), i);
            }
        } else if (sessionDownloadTask.ˈ() != -1) {
            Logger.e("HiAppDownload", "task.getStatus()=" + sessionDownloadTask.ˈ());
        } else if (i == 1) {
            sessionDownloadTask.ʽ(false);
            this.ˏ.ˎ(sessionDownloadTask.ʾ(), i);
        }
    }

    public void ʼ() {
        if (!this.ˏ.ˋ()) {
            ॱˊ();
            ॱˎ();
            ʻॱ();
            if (this.ॱॱ) {
                ॱˋ();
            }
        }
    }

    private void ॱˊ() {
        boolean ˏ = dpi.ˏ(ContentManager.getInstant().getContext());
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (sessionDownloadTask.ˌ() == 8 && ʼ(sessionDownloadTask)) {
                if (ˏ || sessionDownloadTask.ˍ()) {
                    ˊ(sessionDownloadTask.ʾ());
                }
            }
        }
    }

    private void ॱˎ() {
        Context ˋ = ContentManager.getInstant().getContext();
        boolean ॱॱ = doo.ॱॱ(ˋ);
        Object obj = (ॱॱ && doo.ᐝ(ˋ)) ? 1 : null;
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (sessionDownloadTask.ˌ() == 9 && ʼ(sessionDownloadTask)) {
                if ((ॱॱ && obj == null) || sessionDownloadTask.ˍ()) {
                    ˊ(sessionDownloadTask.ʾ());
                }
            }
        }
    }

    private void ʻॱ() {
        Context ˋ = ContentManager.getInstant().getContext();
        boolean ॱॱ = doo.ॱॱ(ˋ);
        Object obj = (ॱॱ && doo.ᐝ(ˋ)) ? 1 : null;
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (sessionDownloadTask.ˌ() == 10 && ʼ(sessionDownloadTask)) {
                if ((ॱॱ && obj == null) || sessionDownloadTask.ˍ()) {
                    ˊ(sessionDownloadTask.ʾ());
                }
            }
        }
    }

    private void ॱˋ() {
        Context ˋ = ContentManager.getInstant().getContext();
        List<SessionDownloadTask> ͺ = ͺ();
        if (dvr.ˏ(ˋ, false)) {
            for (SessionDownloadTask sessionDownloadTask : ͺ) {
                if (ˎ(sessionDownloadTask, false) && ʼ(sessionDownloadTask) && sessionDownloadTask.ˌ() != 8) {
                    ˊ(sessionDownloadTask.ʾ());
                }
            }
            return;
        }
        for (SessionDownloadTask sessionDownloadTask2 : ͺ) {
            if (sessionDownloadTask2.ˌ() == 4 && (sessionDownloadTask2.ʽॱ() & 3) > 0) {
                sessionDownloadTask2.ʼ(false);
                ˊ(sessionDownloadTask2.ʾ());
            }
        }
    }

    public boolean ᐝ() {
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (ˋ(sessionDownloadTask) && ʼ(sessionDownloadTask)) {
                return true;
            }
        }
        return false;
    }

    private void ˎ(int i) {
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (!ˋ(sessionDownloadTask)) {
                this.ˏ.ˎ(sessionDownloadTask.ʾ(), i);
            }
        }
    }

    public boolean ˊ(SessionDownloadTask sessionDownloadTask) {
        return ˎ(sessionDownloadTask, edl.ˏ().ˏॱ());
    }

    public boolean ˎ(SessionDownloadTask sessionDownloadTask, boolean z) {
        if (sessionDownloadTask == null || sessionDownloadTask.ʼ()) {
            return false;
        }
        if (sessionDownloadTask.ˌ() == 0 || sessionDownloadTask.ˌ() == 2 || sessionDownloadTask.ˌ() == 4 || sessionDownloadTask.ˌ() == 8 || sessionDownloadTask.ˌ() == 9 || sessionDownloadTask.ˌ() == 11 || (z && sessionDownloadTask.ˌ() == 1)) {
            return true;
        }
        return false;
    }

    public boolean ˋ(SessionDownloadTask sessionDownloadTask) {
        if (sessionDownloadTask == null) {
            return false;
        }
        if (sessionDownloadTask.ʼ()) {
            return true;
        }
        if (sessionDownloadTask.ˌ() == 0 || sessionDownloadTask.ˌ() == 2 || sessionDownloadTask.ˌ() == 4 || sessionDownloadTask.ˌ() == 8 || sessionDownloadTask.ˌ() == 9 || sessionDownloadTask.ˌ() == 11) {
            return true;
        }
        return false;
    }

    public void ˊ(String str) {
        if (!TextUtils.isEmpty(str)) {
            SessionDownloadTask ˋ = ˋ(str);
            if (ˋ != null && !ˋ(ˋ)) {
                Logger.ˎ("HiAppDownload", "cancelBackGroundTaskBySilent id=" + ˋ.ʾ());
                ˋ(ˋ.ʾ());
            }
        }
    }

    @Nullable
    public List<SessionDownloadTask> ˏ(String str) {
        if (dof.ˋ(str)) {
            return null;
        }
        List<SessionDownloadTask> arrayList = new ArrayList();
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (str.equals(sessionDownloadTask.ˊˊ())) {
                arrayList.add(sessionDownloadTask);
            }
        }
        return arrayList;
    }

    @Nullable
    public SessionDownloadTask ˋ(String str) {
        if (dof.ˋ(str)) {
            return null;
        }
        List<SessionDownloadTask> ˏ = ˏ().ˏ(str);
        if (!CollectCheck.isEmpty((List) ˏ)) {
            for (SessionDownloadTask sessionDownloadTask : ˏ) {
                int ˌ = sessionDownloadTask.ˌ();
                if (ˌ != 9 && ˌ != 10) {
                    return sessionDownloadTask;
                }
            }
        }
        return null;
    }

    public SessionDownloadTask ˎ(String str) {
        SessionDownloadTask ˋ = ˋ(str);
        return (ˋ == null || !ˏ().ˊ(ˋ)) ? null : ˋ;
    }

    public SessionDownloadTask ˊ(String str, int i) {
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (str.equals(sessionDownloadTask.ˊˊ()) && i == sessionDownloadTask.ˌ()) {
                return sessionDownloadTask;
            }
        }
        return null;
    }

    public boolean ॱॱ() {
        return this.ˏ.ˋ();
    }

    public boolean ʽ() {
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (ˋ(sessionDownloadTask) && sessionDownloadTask.ʻ()) {
                return true;
            }
        }
        return false;
    }

    public List<SessionDownloadTask> ͺ() {
        return this.ˏ.ॱ();
    }

    private boolean ॱᐝ() {
        if (doo.ˊ(ContentManager.getInstant().getContext())) {
            return true;
        }
        evk.ॱ(ContentManager.getInstant().getContext().getResources().getString(n.ʹˊ), 0).ˋ();
        return false;
    }

    public void ˎ(String[] strArr, SessionDownloadTask sessionDownloadTask, int i) {
        edc.ˋ().ॱ(new e(sessionDownloadTask, this.ˏ), i, new Bundle(), strArr);
    }

    public void ॱ(SessionDownloadTask sessionDownloadTask) {
        if (sessionDownloadTask != null && sessionDownloadTask.ˌ() == 8) {
            sessionDownloadTask.ˋॱ(11);
        }
        if (sessionDownloadTask != null && !dof.ʽ(sessionDownloadTask.ˊˊ()) && sessionDownloadTask.ˈ() != -1) {
            dsv.ˏ(sessionDownloadTask.ˊˊ());
            ॱॱ(sessionDownloadTask);
            ʻ(sessionDownloadTask);
        }
    }

    public synchronized void ˋॱ() {
        Logger.ˎ("HiAppDownload", "DownloadProxyV2 startAllReserveTasksByWifi");
        this.ॱ.clear();
        Context ˋ = ContentManager.getInstant().getContext();
        List<SessionDownloadTask> ͺ = ͺ();
        if (doo.ॱॱ(ˋ) && !doo.ᐝ(ˋ)) {
            for (SessionDownloadTask sessionDownloadTask : ͺ) {
                if (sessionDownloadTask.ˈ() == -1) {
                    ˊ(sessionDownloadTask.ʾ());
                }
            }
        }
    }

    private boolean ʼ(SessionDownloadTask sessionDownloadTask) {
        return (sessionDownloadTask.ˈ() == 6 && (sessionDownloadTask.ᐝॱ() == 2 || sessionDownloadTask.ᐝॱ() == 0)) || sessionDownloadTask.ˈ() == -1;
    }

    public void ˏ(boolean z) {
        this.ॱॱ = z;
    }

    private void ᐝॱ() {
        for (SessionDownloadTask sessionDownloadTask : ͺ()) {
            if (sessionDownloadTask != null && ˎ(sessionDownloadTask, false)) {
                sessionDownloadTask.ˋ(new dvw());
            }
        }
    }

    public synchronized boolean ʽ(SessionDownloadTask sessionDownloadTask) {
        boolean z = false;
        synchronized (this) {
            String ˊˊ = sessionDownloadTask.ˊˊ();
            int ˌ = sessionDownloadTask.ˌ();
            if (9 == ˌ || 10 == ˌ) {
                if (!ॱ(ˊˊ)) {
                    this.ˏ.ˋ(sessionDownloadTask);
                    z = true;
                } else if (dug.ॱ(ˊˊ) != null) {
                    Logger.ˋ("HiAppDownload", "enqueueTask fail. already exist upgrade SessionDownloadTask");
                } else {
                    Logger.ˋ("HiAppDownload", "enqueueTask fail. already exist SessionDownloadTask");
                }
            } else if (ॱ(ˊˊ)) {
                Logger.ˋ("HiAppDownload", "enqueueTask fail. already exist normal SessionDownloadTask");
            } else {
                ʻ(ˊˊ);
                sessionDownloadTask.ˎ(ˋ(sessionDownloadTask));
                this.ˏ.ˋ(sessionDownloadTask);
                z = true;
            }
        }
        return z;
    }

    private boolean ॱ(String str) {
        if (ˋ(str) != null) {
            return true;
        }
        return false;
    }

    private void ʻ(String str) {
        if (dug.ॱ(str) != null) {
            List<SessionDownloadTask> ˏ = ˏ(str);
            if (!CollectCheck.isEmpty((List) ˏ)) {
                for (SessionDownloadTask ʾ : ˏ) {
                    this.ˏ.ˊ(ʾ.ʾ());
                }
            }
        }
    }

    public void ʻ(SessionDownloadTask sessionDownloadTask) {
        this.ˏ.ˏ(sessionDownloadTask);
    }

    public boolean ˊ(long j) {
        if (this.ˏ.ˋ(j) == null) {
            return false;
        }
        this.ˏ.ॱ(j);
        return true;
    }

    public void ॱ(long j) {
        this.ˏ.ˊ(j);
    }

    public SessionDownloadTask ˎ(long j) {
        return this.ˏ.ˋ(j);
    }

    public void ˋ(long j) {
        this.ˏ.ˏ(j);
    }

    public void ॱ(boolean z) {
        this.ˏ.ˎ(z);
    }

    public void ˊॱ() {
        cdx.ˊ(new Runnable(this) {
            final /* synthetic */ dvt ॱ;

            {
                this.ॱ = r1;
            }

            public void run() {
                cvt o_drh = new drh("downloadConfig");
                Context ˋ = ContentManager.getInstant().getContext();
                try {
                    o_drh.ˏ(String.valueOf(ˋ.getPackageManager().getPackageInfo(ˋ.getPackageName(), 0).versionCode));
                } catch (NameNotFoundException e) {
                    Logger.e("HiAppDownload", "getPolicyParams exception");
                }
                ResponseBean ॱ = cfw.ॱ(o_drh);
                if (ॱ.getResponseCode() == 0 && ॱ.getRtnCode_() == 0) {
                    GeneralResponse generalResponse = (GeneralResponse) ॱ;
                    if (generalResponse.ᐝ() != null && generalResponse.ᐝ().ˋ() != null) {
                        this.ॱ.ॱ(generalResponse.ᐝ().ˋ());
                    }
                }
            }
        });
    }

    private void ॱ(DownloadConfigData downloadConfigData) {
        Map hashMap = new HashMap(6);
        int ˎ = downloadConfigData.ˎ();
        hashMap.put("supportDynamic", String.valueOf(ˎ));
        int ˋ = downloadConfigData.ˋ();
        hashMap.put("connectTimeout", String.valueOf(ˋ));
        int ˏ = downloadConfigData.ˏ();
        hashMap.put("readWriteTimeout", String.valueOf(ˏ));
        Logger.ˎ("HiAppDownload", new StringBuilder(DnsConfig.MAX_CACHE_ENTRIES).append("supportDynamic=").append(ˎ).append(", connectTimeout=").append(ˋ).append(", readWriteTimeout=").append(ˏ).toString());
        List ॱ = downloadConfigData.ॱ();
        hashMap.put("backupDomainList", ॱ(ॱ));
        String ˊ = downloadConfigData.ˊ();
        hashMap.put("directIP", ˊ);
        String ʻ = downloadConfigData.ʻ();
        hashMap.put("directHost", ʻ);
        Logger.ˎ("HiAppDownload", "backupDomainList=" + ॱ(ॱ) + ", directIP=" + ˊ + ", directHost=" + ʻ);
        this.ˏ.ॱ(hashMap);
    }

    public void ˎ(Map<String, String> map) {
        this.ˏ.ॱ((Map) map);
    }

    private String ॱ(List<String> list) {
        if (CollectCheck.isEmpty((List) list)) {
            return null;
        }
        StringBuilder stringBuilder = new StringBuilder();
        for (String append : list) {
            stringBuilder.append(append).append(",");
        }
        return stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString();
    }
}
